package com.aspose.cells;

class zcbe extends zcdb {
   zcbe() {
      this.d = 637;
   }

   void a(zbtz var1, Workbook var2) throws Exception {
      boolean var3 = false;
      int var10;
      if (var1.p() != null) {
         var10 = var1.p().size();
      } else {
         var10 = 1;
      }

      if (var1.i() != null) {
         this.c = new byte[5 + var1.i().length() * 2 + 4 + var10 * 4];
      }

      this.c[0] = 1;
      byte var4 = 1;
      int var11 = zcch.a(this.c, var4, var1.i());
      System.arraycopy(com.aspose.cells.b.a.zc.a(var10), 0, this.c, var11, 4);
      var11 += 4;
      int var7;
      if (var10 == 1) {
         byte var5 = 0;
         int var6 = var1.n();
         System.arraycopy(com.aspose.cells.b.a.zc.a((int)var5), 0, this.c, var11, 2);
         var11 += 2;
         var7 = this.a(var6, var2.getWorksheets());
         System.arraycopy(com.aspose.cells.b.a.zc.a(var7), 0, this.c, var11, 2);
         var11 += 2;
      } else {
         for(int var12 = 0; var12 < var10; ++var12) {
            FontSetting var13 = (FontSetting)var1.p().get(var12);
            var7 = var13.getStartIndex();
            int var8 = var13.getFont().j();
            int var9 = this.a(var8, var2.getWorksheets());
            System.arraycopy(com.aspose.cells.b.a.zc.a(var7), 0, this.c, var11, 2);
            var11 += 2;
            System.arraycopy(com.aspose.cells.b.a.zc.a(var9), 0, this.c, var11, 2);
            var11 += 2;
         }
      }

   }

   private int a(int var1, WorksheetCollection var2) {
      for(int var3 = 0; var3 < var2.z().size(); ++var3) {
         Font var4 = (Font)var2.z().get(var3);
         if (var1 == var4.j()) {
            return var3;
         }
      }

      return -1;
   }
}
